<template>
  <div
    v-if="views.view_type === 'cells_auto_fill'"
    class="cells_auto_fill"
    :style="
      runFunc(
        getStyle(views.body),
        specialStyle(isFlag(views), {
          position: 'relative',
        })
      )
    "
  >
    <a
      v-for="(view, index) of views.body.items"
      :key="index"
      :style="
        runFunc(
          getStyle(view),
          specialStyle(isFlag(views) && (view.x || view.y), {
            position: 'absolute',
          })
        )
      "
    >
      <img v-lazy="addHttps(view.img_url)" />
    </a>
  </div>
</template>

<script type="text/ecmascript-6">
import { homeMixin } from 'assets/js/mixin'

export default {
  mixins: [homeMixin],
  props: {
    views: {
      type: Object,
      default() {
        return {}
      }
    }
  },
}

</script>

<style lang="stylus" scoped ref="stylesheet/stylus">
a {
  display: inline-block;

  img {
    vertical-align: top;
    width: 100%;
    height: 100%;
  }
}
</style>